import React, { PropsWithChildren } from "react";
import { ThemeConfig, ConfigProvider } from "antd";
import { ButtonToken } from "antd/es/button/style";
import "./styles/lib.css";

const theme = {
  token: {
    colorPrimary: "#0c62ff",
    colorPrimaryBgHover: "#a8d2ff",
    colorSuccess: "#36b37e",
    colorWarning: "#ffab00",
    colorError: "#ff5630",
    colorInfo: "#0c62ff",
    borderRadius: 4,
    borderRadiusLG: 4,
    borderRadiusSM: 4,
  },
  components: {
    Button: {} as ButtonToken,
  },
} as ThemeConfig;

export const Provider: React.FC<PropsWithChildren<{}>> = ({ children }) => (
  <ConfigProvider prefixCls="gui" theme={theme}>
    {children}
  </ConfigProvider>
);
